package com.hjf.demo;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;

public class MainActivity extends Activity {
	private EditText text1, text2;
	private Button button;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);

		text1 =  (EditText) findViewById(R.id.editText1);
		text2 = (EditText) findViewById(R.id.editText2);
		button = (Button) findViewById(R.id.button1);

		button.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				String inputString1 = text1.getText().toString();
				String inputString2 = text2.getText().toString();
				Intent itt = new Intent();
				itt.setClass(MainActivity.this, ResultActivity.class);
				itt.putExtra("user", inputString1);
				itt.putExtra("pwd", inputString2);
				startActivity(itt);
			}
		});
	}

}
